Skip to content

fix: tag transient API errors as INFRA_ERROR in drift tests#234

Merged
jpr5 merged 2 commits into
mainfrom
fix/drift-infra-error-tagging
May 21, 2026
Merged

fix: tag transient API errors as INFRA_ERROR in drift tests#234
jpr5 merged 2 commits into
mainfrom
fix/drift-infra-error-tagging

Conversation

@jpr5
Copy link
Copy Markdown
Contributor

@jpr5 jpr5 commented May 21, 2026

Summary

  • Wrap all 15 exported provider functions in withInfraErrorTag() so transient API failures (rate limits, network timeouts, auth errors) throw with a structured INFRA_ERROR: <provider> — <message> prefix instead of raw stack traces
  • Add /^INFRA_ERROR:/m to the collector's infraIndicators array so these are classified as infrastructure errors and don't crash the pipeline

Follows up on PR #230 which fixed the collector's JSON parsing and added basic stack trace classification. This change moves the tagging upstream to the test layer so the collector never sees unparseable failures from transient errors.

Test plan

  • 3202 tests pass (90 files)
  • Prettier clean
  • ESLint clean

Wrap all 15 exported provider functions in withInfraErrorTag() so
transient failures (rate limits, network timeouts, auth errors) throw
with a structured INFRA_ERROR: prefix instead of raw stack traces.
Add /^INFRA_ERROR:/m to the collector's infraIndicators so these are
classified as infrastructure errors and don't crash the pipeline.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@copilotkit/aimock@234

commit: 13fb7bd

@jpr5 jpr5 merged commit c0e0f6a into main May 21, 2026
23 checks passed
@jpr5 jpr5 deleted the fix/drift-infra-error-tagging branch May 21, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant